package com.itbaizhan.springdemo6.domain;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

//SpringBoot可以校验对象参数中的每个属性
public class Student {
    @NotNull(message = "id不能为空")
    private int id;
    @NotBlank(message = "姓名不能为空")
    private String name;

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
